package com.star.cat.common.vo;

import java.io.Serializable;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

import lombok.Data;

@Data
@SuppressWarnings("serial")
public class CacheVo implements Serializable {

    private String key;
    private Object value;
    private String expireTime;

    public CacheVo() {
    }

    public CacheVo(String key, Object value, Instant expireTime) {
        this.key = key;
        this.value = value;
        LocalDateTime localDateTime = LocalDateTime.ofInstant(expireTime, ZoneId.systemDefault());
        this.expireTime = localDateTime.format(DateTimeFormatter.ofPattern("yyyy:MM:dd HH:mm:ss"));
    }
}
